<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <%= render :partial => "shared/head" %>
  <link rel="alternate" type="application/atom+xml" title="<%= @pipeline.getName() %> stages - Atom" href="<%= @feed_api_url -%>"/>
</head>
<body id="<%= page_name %>" class="<%= page_name %>" <%= render "shared/body_data_attrs" %>>
<div class="page-wrap">
  <div id="body_bg">
    <div id="body_bg_highlight">
      <div id="body_wrapper">
        <%= render :partial => "shared/header" %>
        <%
           show_stage_history_widget = !['pipeline', 'stats'].include?(params[:action])
        -%>

        <div id='body_content' class="<%= show_stage_history_widget ? "two_col" : "one_col" %>">
          <div class="messaging_wrapper" id="messaging_wrapper">
            <%= render :partial => "shared/flash_message" %>
          </div>

          <div id="pipeline_header">
              <%= render :partial => "pipelines/pipeline_header", :locals => {:scope => {}} %>

          </div>

          <%= content_wrapper_tag %>
          <div class="row">
            <div id="pipeline_status_bar" class="pipeline_flow">
              <%= render :partial => "pipelines/status_bar", :locals => {:scope => {:pipeline => @pipeline, :current_config_version => @current_config_version, :stage_config_version => @stage.getStage().getConfigVersion()}} %>
            </div>
            <div class="page_title_bar">
              <%
                 page_status_bar_class = 'state_'
                 if !@stage.nil? && !@stage.getState().nil?
                   page_status_bar_class += @stage.getState().to_s
                 end
              %>
              <div id="page_status_bar" class="page_status_bar <%= page_status_bar_class %>">
                <% if @show_stage_status_bar %>
                    <%= render :partial => "stages/status_bar.html" %>
                <% end %>
              </div>
            </div>
            <div class="page_nav">
            </div>
            <div class="rail">
              <% if show_stage_history_widget %>
                  <div id="stage_history" class="stage_history overview_widget">
                    <%= render :partial => "stages/stage_history.html", :locals => {:scope => {:stage_history_page => @stage_history_page, :tab => params[:action], :current_stage_pipeline => @pipeline, :current_config_version => @current_config_version}} %>
                  </div>
                  <input type="hidden" id="stage-history-page" value="<%= @stage_history_page.currentPage() %>"/>
              <% end %>
            </div>

            <div class="content">
              <%= yield %>
            </div>
          </div>
          <%= end_content_wrapper %>
        </div>
      </div>
    </div>
  </div>
</div>

<%= render :partial => 'navigation_elements/footer' %>

</body>
</html>

